import Cookies from 'js-cookie'
import store from '../store'
const TokenKey = 'Authorization'

export function getToken() {
  let token = localStorage.getItem('Token')
  return token
}
export function setToken(token) {
  // Cookies.set(TokenKey, token);
  return localStorage.setItem('Token', JSON.stringify(token))
}
export function getUserInfo() {
  let userInfo =
    localStorage.getItem('userInfo') == 'undefined'
      ? {}
      : JSON.parse(localStorage.getItem('userInfo'))
  return userInfo
}
export function setUserInfo(userInfo) {
  return localStorage.setItem('userInfo', JSON.stringify(userInfo))
}
export function setRemoveToken() {
  return localStorage.removeItem('Token')
}
export function setRemoveUser() {
  return localStorage.removeItem('userInfo')
}
